if (subcommand_name == NULL)
{
+ void (*print_func) (const gchar *format, ...) = want_help ? g_print : g_printerr;
+
subcommand = admin_instutil_subcommands;
- g_print ("usage: ostree admin instutil COMMAND [options]\n");
- g_print ("Builtin commands:\n");
+ print_func ("usage: ostree admin instutil COMMAND [options]\n");
+ print_func ("Builtin commands:\n");
while (subcommand->name)
{
- g_print (" %s\n", subcommand->name);
+ print_func (" %s\n", subcommand->name);
subcommand++;
}
if (subcommand_name == NULL)
{
+ void (*print_func) (const gchar *format, ...) = want_help ? g_print : g_printerr;
+
subcommand = admin_subcommands;
- g_print ("usage: ostree admin --sysroot=PATH COMMAND [options]\n");
- g_print ("Builtin commands:\n");
+ print_func ("usage: ostree admin --sysroot=PATH COMMAND [options]\n");
+ print_func ("Builtin commands:\n");
while (subcommand->name)
{
- g_print (" %s\n", subcommand->name);
+ print_func (" %s\n", subcommand->name);
subcommand++;
}
g_set_error_literal (&error, G_IO_ERROR, G_IO_ERROR_FAILED,
"No command specified");
}
- ostree_usage (argv, commands, TRUE);
+ ostree_usage (argv, commands, !want_help);
goto out;
}